# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=multitail
pkgver=7.1.2
pkgrel=0
pkgdesc="MultiTail lets you view one or multiple files like the original tail program"
arch="all"
url="http://www.vanheusden.com/multitail"
license="Apache-2.0"
depends="ncurses coreutils"
makedepends="ncurses-dev cmake ninja"
checkdepends="cppcheck"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/folkertvanheusden/multitail/archive/refs/tags/$pkgver.tar.gz
	linux-is-not-debian-ncurses.patch"

options="!check" # no tests provided

prepare() {
	default_prepare
	sed -i "s|@VERSION@|$pkgver|" CMakeLists.txt
}

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCURSES_INCLUDE_PATH=/usr/include .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
6f006d68a6c0fcfec9f6aada4a1ad0a031b61ea46c60231faa6fd7ea934f6f74ca30f12f8983658c9ae6ae2e08bade9159e3426ed47cd9171d0b190ec9f3e5b5  multitail-7.1.2.tar.gz
8f9a02b37187af204a1b00646e9657ead1c70bb1f3ee9dda922186b24060f5e9bd9d7d3cfe7f29ccbc242ff69a515e010b11d51c41112ca77acd910e2de2e9db  linux-is-not-debian-ncurses.patch
"
